import delimited "C:\Users\mariu\Downloads\icb1v14.csv", clear
drop if yrtrig>1939
gen dur= yrterm-yrtrig+1
expand dur
gen year=yrtrig
order year, after(crisno)
sort crisno year
replace year=year+1 if year==year[_n-1] & crisno==crisno[_n-1]
replace year=year+1 if year==year[_n-1] & crisno==crisno[_n-1]
drop if year<1920
drop if year>1939

export delimited using "C:\Users\mariu\Documents\GitHub\interwar_econ\data\crisis_figuredata.csv", replace



*sort year

*preserve

*gen number=1
*collapse (sum) number geostr , by(year)

*twoway bar number year, scheme(plotplain) title("Crisis Number") ytitle("Crisis Number") name(crises1, replace)
*twoway bar geostr year, scheme(plotplain) title("Total Crisis Salience") ytitle("Total Crisis Salience") name(crises2, replace)
*graph combine crises1 crises2, scheme(plotplain)
*restore
